<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>档案管理</title>
<!--[if lt IE 9]>
  <script src="libs/html5shiv.min.js"></script>
  <script src="libs/respond.min.js"></script>
  <![endif]-->
<script src="libs/jquery-1.12.1.min.js"></script>
<link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>
<script src="libs/handlebars.min.js" type="text/javascript"></script>
<script src="libs/d3.v3.min.js" type="text/javascript"></script>
<script src="libs/nv.d3.min.js" type="text/javascript"></script>
<script src="libs/dateFormat.js" type="text/javascript"></script>
<link href="libs/bootstrap-3.3.6/css/nv.d3.min.css" rel="stylesheet">
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="page-header">
				<h1 align="center">
					<strong>档案管理</strong>
					</h2>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-8">
				<ul class="nav nav-pills">
					<li class="active"><a href="index.html">首页</a></li>
					<li><a href="add_Archive.html"><strong>添加信息</strong></a></li>
					<li><a href="querymh.html"><strong>查询</strong></a></li>
					
					<li><a href="login.html"><strong>用户：</strong><span
							id="text"></span></a></li>
				</ul>
			</div>
			<div class="col-md-offset-8">
				<ul class="nav nav-pills">
					<li>
						<div className="input-group">
							<input className="for_control" id="search-box-value"
								placeholder="档案号或身份证号" type="text" /> <span
								className="input-group-btn">
								<button className="btn btn-default" id="search" type=button>
									<i className="fa fa-search">搜索</i>
								</button>
							</span>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<hr />
			</div>
		</div>
	</div>
	<div class="container">
		
			<div class="row">
				<div class="col-md-12">
					<div class="panel panel-primary">
						<div class="panel-heading">
							<h1><strong>最近浏览的四份档案</strong>	</h1>
						</div>
						<div class="panel-body" id="list1"></div>
					</div>
				</div>
			</div>
	
		
		<div class="row">
			<div class="col-md-12">
				<div class="panel panel-success">
					<div class="panel-heading">

						<h1>	<strong>最近添加的四份档案</strong></h1>
						
					</div>
					<div class="panel-body" id="list2"></div>
				</div>
			</div>
		</div>
	
	</div>
	<div class="container">
		<div class="row">
				<div class="col-md-9">
				<div class="col-md-7">
		        输入时间<input id="start" type=date />&nbsp;-&nbsp;
                  <input id="end"  type=date />
                  </div>
                  <div class="col-md-2">
                  <button id="shijian" class="btn btn-primary btn-block">统计</button>
                  </div>
                  
                  </div>
                      </div>
                       </div>
	<div class="container">
		<div class="row">
			<div class="col-md-12" id="chart">
				<p class="text-center">
					<br />
				<hr />
				<strong>上传档案统计</strong>	
				<svg style="height: 480px; width: 100%"></svg>
				<br>
				</p>
			</div>
		
	</div>
	</div>
<script id="template" type="text/x-handlebars-template">
{{#each item}}
<div class="panel panel-default col-md-3 ">
   <div class="panel-body">
     <dl>
<dt>档案号</dt><dd>{{archive_id}}</dd>
<dt>身份证号</dt><dd>{{identity}}</dd>
<dt>姓名</dt><dd>{{name}}</dd>
<dt>性别</dt><dd>{{gender}}</dd>
<dt>出生日期</dt><dd>{{birthday}}</dd>
<dt>预退休日期</dt><dd>{{date_retire1}}</dd>
<dt>实际退休日期</dt><dd>{{date_retire2}}</dd>
<dt>特殊工种</dt><dd>{{sp}}</dd>
<dt>女管理岗位 </dt><dd>{{fc}}</dd>
<dt>职称</dt><dd>{{title}}</dd>
<dt>工龄</dt><dd>{{seniority}}</dd>
     </dl>
   </div>
 </div>
{{/each}}
{{#each item1}}
<div class="panel panel-default col-md-3 ">
   <div class="panel-body">
     <dl>
<dt>档案号</dt><dd>{{archive_id}}</dd>
<dt>身份证号</dt><dd>{{identity}}</dd>
<dt>姓名</dt><dd>{{name}}</dd>
<dt>性别</dt><dd>{{gender}}</dd>
<dt>出生日期</dt><dd>{{birthday}}</dd>
<dt>预退休日期</dt><dd>{{date_retire1}}</dd>
<dt>实际退休日期</dt><dd>{{date_retire2}}</dd>
<dt>特殊工种</dt><dd>{{sp}}</dd>
<dt>女管理岗位 </dt><dd>{{fc}}</dd>
<dt>职称</dt><dd>{{title}}</dd>
<dt>工龄</dt><dd>{{seniority}}</dd>
     </dl>
   </div>
 </div>
{{/each}}
</script>
	<script type="text/javascript">
		$(function() {
			$.getJSON('JQ_query_four.action', function(res) {
				var data = {
					'item' : res
				};
				var t = Handlebars.compile($('#template').html());
				$('#list1').html(t(data));

			});
			$.getJSON('JQ_add_four.action', function(res) {
				var data = {
					'item1' : res
				};
				var t = Handlebars.compile($('#template').html());
				$('#list2').html(t(data));

			});
		
			$('#search').click(function() {
				$.post('query_one.action', {
					search : $('#search-box-value').val()
				}, function(res, status) {
					if ('ERR1' == res) {
						alert('没有查到数据');
					} else if ('ERR2' == res) {
						alert('请输入正确信息');
					} else {
				
						window.location.href = 'queryOne.html?id=' + res;
					}
				});
			});
		})
	</script>
	<script type="text/javascript">
		$(function() {
			$('#cleanCookie').click(function() {
				$.post('cleanCookie.action', {

				}, function(res, status) {
					if ('OK' == res) {
						window.loc
						ation.href = 'login.html';
					}
				});
			});
		});
	</script>
	<script type="text/javascript">
		$(function() {
			$.getJSON('queryuser.action', function(res) {
				
               
				$('#text').text(res.nickname);
			});
		});
	</script>
<script type="text/javascript">
		$(function() {
			var d2 =new Date();
			$('#end').val(d2.format('yyyy-MM-dd'));
			var d1 =new Date();
			$('#start').val(d1.format('yyyy-MM-01'));
			$('#shijian').click(function() {
				$.post('statis.action', {
					date1:$('#start').val(),
					date2:$('#end').val(),
				}, function(res, status) {
					nv.addGraph(function() {
						var chart = nv.models.pieChart().x(function(d) {
							return d.nickname
						}).y(function(d) {
							return d.counter
						}).showLabels(true).labelType('percent');
						d3.select("#chart svg").datum(res).transition().duration(
								350).call(chart);
						return chart;
					})
				});
			});
		});
	</script>
</body>
</html>